package com.wfm.niuke.dynamic;

import java.util.Arrays;

public class bm63P剑指Offer10II青蛙跳台阶问题 {
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public int numWays(int n) {
        if(n==1||n==0) return 1;
        if(n==2) return 2;
        int[] dp = new int[n+1];
        dp[0] = 1;
        dp[1] = 1;
        for (int i = 2; i <= n; i++) {
            dp[i] = (dp[i-2]+dp[i-1])%1000000007;
        }
        System.out.println(Arrays.toString(dp));
        return dp[n];
    }
}
//leetcode submit region end(Prohibit modification and deletion)

    public static void main(String[] args) { 
        Solution solution = new bm63P剑指Offer10II青蛙跳台阶问题().new Solution();
        System.out.println(solution.numWays(3));
    }
}